# Created with pycharm
# author:ju bai
# Date:2021/7/25
# Time:15:13
from selenium import webdriver
import time
import unittest


class Test(unittest.TestCase):
    def setUp(self):
        self.drive = webdriver.Chrome()
        # self.url = "https://www.baidu.com/"
        self.url = "http://1.117.168.80:8080/practice/log.html"
        self.drive.maximize_window()
        time.sleep(3)

    def tearDown(self):
        self.drive.quit()

    def test_baidu(self):
        driver = self.drive
        url = self.url
        driver.get(url)
        driver.find_element_by_id("username").send_keys("admin")
        driver.find_element_by_id("password").send_keys("123")
        driver.find_element_by_xpath("/html/body/div/input[3]").click()
        # driver.find_element_by_id("kw").send_keys("你好")
        # driver.find_element_by_id("su").click()
        time.sleep(3)

    if __name__ == "__main__":
        unittest.main()
